﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class PlayManager : MonoBehaviour {

    public static PlayManager Instance;

    public int sumScore = 0;

    private AudioSource audio;

    public AudioClip clipCollectible;

    public AudioClip clipEnemyDies;

    public AudioClip clipPlayerJump;

    public Text txtScore = null;

    void Awake() {
        Instance = this;
        audio = this.GetComponent<AudioSource>();
    }

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    public void AddScore(int score)
    {
        sumScore += score;
        txtScore.text = "SCORE : " + sumScore;
    }

    public void PlayCollectible()
    {
        audio.PlayOneShot(clipCollectible);
    }

    public void PlayEnemyDies()
    {
        audio.PlayOneShot(clipEnemyDies);
    }

    public void PlayPlayerJump()
    {
        audio.PlayOneShot(clipPlayerJump);
    }
}
